home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
051-060
/
amok51
/
m2
/
defs
/
conversions.def
< prev
next >
Wrap
Text File
|
1993-11-04
|
992b
|
32 lines
DEFINITION MODULE Conversions; (* jr/17mai87 *)
(*$ NameChk:=FALSE *)
PROCEDURE StrToVal(VAR s: ARRAY OF CHAR; VAR l: LONGINT; VAR signed: BOOLEAN;
base: INTEGER; VAR err: BOOLEAN);
(* Converts a string 's' with base 'base' to value 'l'.
Possible error conditions:
- illegal 'base'
- some characters in 's' are illegal digits to 'base'
- the resulting value is too large for a LONGINT
*)
PROCEDURE ValToStr(l: LONGINT; signed: BOOLEAN; VAR s: ARRAY OF CHAR;
base, width: INTEGER; fillC: CHAR; VAR err: BOOLEAN);
(* Converts value 'l' with base 'base' to output string 's'. The value will
be positioned within a field of size 'width'. If 'width' is larger than
the needed amount of characters to represent 'l', the field is filled up
with 'fillC'.
'width'>0: number is right adjusted
'width'<0: number is left adjusted
Possible error conditions:
- illegal 'base'
- 's' is to small
*)
END Conversions.def